@echo off

:: 这几个 path 需要根据自己的环境来配置
set JAVA_HOME=C:\Program Files\Eclipse Adoptium\graalvm-jdk-21.0.2+13.1
set IDEA_HOME=C:\Program Files\JetBrains\IntelliJ IDEA 2022.2.3
:: maven 相关 path
set MAVEN_HOME=%IDEA_HOME%\plugins\maven\lib\maven3
set CLASS_WORLDS_CONF=%IDEA_HOME%\plugins\maven\lib\maven3\bin\m2.conf
set CLASS_WORLDS_CLASS_PATH=%IDEA_HOME%\plugins\maven\lib\maven3\boot\plexus-classworlds-2.7.0.jar;%IDEA_HOME%\plugins\maven\lib\maven3\boot\plexus-classworlds.license
set MAVEN_EXT_PATH=%IDEA_HOME%\plugins\maven\lib\maven-event-listener.jar
set "CURRENT_DIR=%~dp0"
set "PROJECT_HOME=%CURRENT_DIR:~0,-8%"
"%JAVA_HOME%\bin\java.exe" "-Dmaven.home=%MAVEN_HOME%" -Dmaven.multiModuleProjectDirectory="%PROJECT_HOME%" "-Dclassworlds.conf=%CLASS_WORLDS_CONF%" "-Dmaven.ext.class.path=%MAVEN_EXT_PATH%" -classpath "%CLASS_WORLDS_CLASS_PATH%" org.codehaus.classworlds.Launcher -T 16 -DskipTests=true -Pnative native:compile